package com.zuikaku.nettychat.dao;

import com.zuikaku.nettychat.pojo.Chat;
import com.zuikaku.nettychat.vo.ChatVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ChatMapper {
    int deleteByPrimaryKey(Integer chatId);

    int insert(Chat record);

    int insertSelective(Chat record);

    Chat selectByPrimaryKey(Integer chatId);

    int updateByPrimaryKeySelective(Chat record);

    int updateByPrimaryKeyWithBLOBs(Chat record);

    int updateByPrimaryKey(Chat record);

    List<Chat> selectAll();

//    追加
    List<ChatVO> getChatVOByUserId(@Param("userId") Integer userId);

    ChatVO selectChatVOByBothId(@Param("currentUserId") int currentUserId,@Param("opponentId") int opponentId);

    ChatVO selectChatVOByPKForSender(@Param("chatId") Integer chatId);
}